import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '提现人',
    align: "center",
    dataIndex: 'takeMemberName',
    width: '80px'

  },
  {
    title: '真实姓名',
    align: "center",
    dataIndex: 'name',
    width: '80px'

  },
  {
    title: '手机号',
    align: "center",
    dataIndex: 'mobile',
    width: '120px'

  },
  {
    title: '提现金额',
    align: "center",
    dataIndex: 'amount',
    width: '80px'
  },
  {
    title: '手续费',
    dataIndex: 'handlingFeeAmount',
    width: '80px'

  },
  {
    title: '手续费比例',
    dataIndex: 'handlingFee',
    width: '120px',
    customRender: ({ text }) => {
      text = text * 100 + '%'
      return text;
    },

  },
  {
    title: '提现类型',
    align: "center",
    dataIndex: 'type',
    width: '80px',
    customRender: ({ text }) => {
      text = text == 1 ? '支付宝' : text == 0 ? '微信' : '银行卡';
      return text;
    },
  },
  {
    title: '收款码',
    align: "center",
    dataIndex: 'image',
    customRender: render.renderImage,

  },
  {
    title: '收款账号',
    align: "center",
    dataIndex: 'aliAccount'
  }, {
    title: '银行卡账号',
    align: "center",
    dataIndex: 'idCard'
  },
  {
    title: '提现状态',
    align: "center",
    dataIndex: 'status',
    customRender: ({ text }) => {
      text = text == 2 ? '通过' : text == 1 ? '驳回' : '未审核';
      return text;
    },
  },


  {
    title: '申请提现时间',
    align: "center",
    dataIndex: 'createTime'
  },
  // {
  //   title: '收款支付宝名称',
  //   align: "center",
  //   dataIndex: 'aliName'
  // },
  // {
  //   title: '收款支付宝账户',
  //   align: "center",
  //   dataIndex: 'aliAccount'
  // },
  {
    title: '审核意见',
    align: "center",
    dataIndex: 'judgeMsg'
  },
  // {
  //   title: '转账提现单号',
  //   align: "center",
  //   dataIndex: 'outBizNo'
  // },
  // {
  //   title: '转账提现状态 0未发起 1已发起 2已完成 3失败 4待用户确认收款',
  //   align: "center",
  //   dataIndex: 'tranStatus'
  // },
  // {
  //   title: '转账接口返回状态码',
  //   align: "center",
  //   dataIndex: 'tranMsg'
  // },

  {
    title: '审核时间',
    align: "center",
    dataIndex: 'judgeTime'
  },
  {
    title: '审核人',
    align: "center",
    dataIndex: 'judgeBy'
  },

];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "提现人",
    field: 'takeMemberName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "手机号",
    field: 'mobile',
    component: 'Input',
    //colProps: {span: 6},
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '提现人',
    field: 'takeMemberName',
    component: 'Input',
  },
  {
    label: '提现/转化金额',
    field: 'amount',
    component: 'InputNumber',
  },
  {
    label: '提现/转化人',
    field: 'takeMember',
    component: 'Input',
  },
  {
    label: '提现/转化状态',
    field: 'status',
    component: 'Input',
  },
  {
    label: '收款支付宝名称',
    field: 'aliName',
    component: 'Input',
  },
  {
    label: '收款支付宝账户',
    field: 'aliAccount',
    component: 'Input',
  },
  {
    label: '审核意见',
    field: 'judgeMsg',
    component: 'Input',
  },
  {
    label: '转账提现单号',
    field: 'outBizNo',
    component: 'Input',
  },
  {
    label: '转账提现状态 0未发起 1已发起 2已完成 3失败 4待用户确认收款',
    field: 'tranStatus',
    component: 'InputNumber',
  },
  {
    label: '转账接口返回状态码',
    field: 'tranMsg',
    component: 'Input',
  },
  {
    label: '0 金额  1积分',
    field: 'type',
    component: 'InputNumber',
  },
  {
    label: '真实姓名',
    field: 'name',
    component: 'Input',
  },
  {
    label: '转账返回的数据 拉起用户确认转账使用',
    field: 'packageInfo',
    component: 'InputTextArea',
  },
  {
    label: '转账微信返回i订单ID',
    field: 'transferBillNo',
    component: 'Input',
  },
  {
    label: '审核时间',
    field: 'judgeTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '审核人',
    field: 'judgeBy',
    component: 'Input',
  },
  {
    label: '手机号',
    field: 'mobile',
    component: 'Input',
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false
  },
];

// 高级查询数据
export const superQuerySchema = {
  takeMemberName: { title: '提现人', order: 0, view: 'text', type: 'string', },
  amount: { title: '提现/转化金额', order: 1, view: 'number', type: 'number', },
  takeMember: { title: '提现/转化人', order: 2, view: 'text', type: 'string', },
  status: { title: '提现/转化状态', order: 3, view: 'text', type: 'string', },
  aliName: { title: '收款支付宝名称', order: 4, view: 'text', type: 'string', },
  aliAccount: { title: '收款支付宝账户', order: 5, view: 'text', type: 'string', },
  judgeMsg: { title: '审核意见', order: 6, view: 'text', type: 'string', },
  outBizNo: { title: '转账提现单号', order: 7, view: 'text', type: 'string', },
  tranStatus: { title: '转账提现状态 0未发起 1已发起 2已完成 3失败 4待用户确认收款', order: 8, view: 'number', type: 'number', },
  tranMsg: { title: '转账接口返回状态码', order: 9, view: 'text', type: 'string', },
  type: { title: '0 金额  1积分', order: 10, view: 'number', type: 'number', },
  name: { title: '真实姓名', order: 11, view: 'text', type: 'string', },
  packageInfo: { title: '转账返回的数据 拉起用户确认转账使用', order: 12, view: 'textarea', type: 'string', },
  transferBillNo: { title: '转账微信返回i订单ID', order: 13, view: 'text', type: 'string', },
  judgeTime: { title: '审核时间', order: 14, view: 'datetime', type: 'string', },
  judgeBy: { title: '审核人', order: 15, view: 'text', type: 'string', },
  mobile: { title: '手机号', order: 16, view: 'text', type: 'string', },
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}